package approve.adapter;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import approve.action.R;
import model.pojo.ListApprove;

public class My_ViewForm15_Approver_adapter extends BaseAdapter implements OnClickListener {

	private Context context;
	private List<ListApprove> listapprover;
	
	public My_ViewForm15_Approver_adapter(Context context,List<ListApprove> listapprover){
		this.context=context;
		this.listapprover=listapprover;
	}
	
	public int getCount() {
		// TODO Auto-generated method stub
		return listapprover.size();
	}

	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return listapprover.get(position);
	}

	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ListApprove entry=listapprover.get(position);
		if(convertView==null){
			LayoutInflater inflater=(LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView=inflater.inflate(R.layout.approve_row, null);
		}
		TextView tvTitleError=(TextView)convertView.findViewById(R.id.titleError);
		tvTitleError.setText(entry.getFullnameEmp());

		DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
		TextView tvPhone = (TextView) convertView.findViewById(R.id.tvMobile);
        tvPhone.setText(entry.getStatus_()+" _ "+entry.getDateApprove());

		return convertView;
	}

	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

}
